// vite.config.ts
import vue from "file:///C:/CODE/spicy-iot/spicy-iot-web/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import { resolve } from "path";
import { defineConfig, loadEnv } from "file:///C:/CODE/spicy-iot/spicy-iot-web/node_modules/vite/dist/node/index.js";
import vueSetupExtend from "file:///C:/CODE/spicy-iot/spicy-iot-web/node_modules/vite-plugin-vue-setup-extend/dist/index.mjs";
import AutoImport from "file:///C:/CODE/spicy-iot/spicy-iot-web/node_modules/unplugin-auto-import/dist/vite.js";
import topLevelAwait from "file:///C:/CODE/spicy-iot/spicy-iot-web/node_modules/vite-plugin-top-level-await/exports/import.mjs";
import { createStyleImportPlugin, VxeTableResolve } from "file:///C:/CODE/spicy-iot/spicy-iot-web/node_modules/vite-plugin-style-import/dist/index.mjs";
import viteCompression from "file:///C:/CODE/spicy-iot/spicy-iot-web/node_modules/vite-plugin-compression/dist/index.mjs";

// src/components/IconSelector/index.ts
import { readFileSync, readdirSync } from "fs";
var idPerfix = "";
var iconNames = [];
var svgTitle = /<svg([^>+].*?)>/;
var clearHeightWidth = /(width|height)="([^>+].*?)"/g;
var hasViewBox = /(viewBox="[^>+].*?")/g;
var clearReturn = /(\r)|(\n)/g;
var clearFill = /(fill="[^>+].*?")/g;
function findSvgFile(dir) {
  const svgRes = [];
  const dirents = readdirSync(dir, {
    withFileTypes: true
  });
  for (const dirent of dirents) {
    iconNames.push(`${idPerfix}-${dirent.name.replace(".svg", "")}`);
    if (dirent.isDirectory()) {
      svgRes.push(...findSvgFile(dir + dirent.name + "/"));
    } else {
      const svg = readFileSync(dir + dirent.name).toString().replace(clearReturn, "").replace(clearFill, 'fill=""').replace(svgTitle, ($1, $2) => {
        let width = 0;
        let height = 0;
        let content = $2.replace(clearHeightWidth, (s1, s2, s3) => {
          if (s2 === "width") {
            width = s3;
          } else if (s2 === "height") {
            height = s3;
          }
          return "";
        });
        if (!hasViewBox.test($2)) {
          content += `viewBox="0 0 ${width} ${height}"`;
        }
        return `<symbol id="${idPerfix}-${dirent.name.replace(".svg", "")}" ${content}>`;
      }).replace("</svg>", "</symbol>");
      svgRes.push(svg);
    }
  }
  return svgRes;
}
var svgBuilder = (path, perfix = "local") => {
  if (path === "") return;
  idPerfix = perfix;
  const res = findSvgFile(path);
  return {
    name: "svg-transform",
    transformIndexHtml(html) {
      return html.replace(
        "<body>",
        `
                <body>
                <svg id="local-icon" data-icon-name="${iconNames.join(
          ","
        )}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position: absolute; width: 0; height: 0">
                ${res.join("")}
                </svg>
                `
      );
    }
  };
};

// vite.config.ts
var __vite_injected_original_dirname = "C:\\CODE\\spicy-iot\\spicy-iot-web";
var pathResolve = (dir) => {
  return resolve(__vite_injected_original_dirname, ".", dir);
};
var alias = {
  "/@": pathResolve("./src/"),
  "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js"
};
var viteConfig = defineConfig((mode) => {
  const env = loadEnv(mode.mode, process.cwd());
  const isDev = env.ENV === "development";
  return {
    plugins: [
      vue(),
      // Vue 插件
      svgBuilder("./src/assets/icons/"),
      // 将 SVG 文件转换成 Vue 组件
      vueSetupExtend(),
      // setup语法糖增强插件
      AutoImport({
        imports: ["vue", "vue-router", "pinia"],
        // 自动导入的依赖库数组
        dts: "./auto-imports.d.ts"
        // 自动导入类型定义文件路径
      }),
      createStyleImportPlugin({
        resolves: [VxeTableResolve()]
        // 配置vxetable 按需加载
      }),
      topLevelAwait({
        promiseExportName: "__tla",
        // TLA Promise 变量名
        promiseImportName: (i) => `__tla_${i}`
        // TLA Promise 导入名
      }),
      viteCompression({
        deleteOriginFile: false
        // 压缩后删除原来的文件
      })
    ],
    root: process.cwd(),
    // 项目根目录
    resolve: { alias },
    // 路径别名配置
    base: mode.command === "serve" ? "./" : env.VITE_PUBLIC_PATH,
    optimizeDeps: {
      include: ["element-plus/es/locale/lang/zh-cn", "element-plus/es/locale/lang/en"]
    },
    server: {
      host: "0.0.0.0",
      // 服务器地址
      port: env.VITE_PORT,
      // 服务器端口号
      open: env.VITE_OPEN === "true",
      // 是否自动打开浏览器
      hmr: true,
      // 启用热更新
      proxy: {
        "/api/gen": {
          //单体架构下特殊处理代码生成模块代理
          target: env.VITE_IS_MICRO === "true" ? env.VITE_ADMIN_PROXY_PATH : env.VITE_GEN_PROXY_PATH,
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, "")
        },
        "/api": {
          target: env.VITE_ADMIN_PROXY_PATH,
          // 目标服务器地址
          ws: true,
          // 是否启用 WebSocket
          changeOrigin: true,
          // 是否修改请求头中的 Origin 字段
          rewrite: (path) => path.replace(/^\/api/, "")
        },
        "^/ws/info/.*": {
          target: env.VITE_ADMIN_PROXY_PATH,
          // 目标服务器地址
          ws: true,
          // 是否启用 WebSocket
          changeOrigin: true
        }
      }
    },
    build: {
      outDir: "dist",
      // 打包输出目录
      chunkSizeWarningLimit: 1500,
      // 代码分包阈值
      // 开发使用 esbuild 更快，生产环境打包使用 terser 可以删除更多注释
      minify: isDev ? "esbuild" : "terser",
      terserOptions: {
        compress: {
          drop_console: true,
          // 删除 console
          drop_debugger: true
          // 删除 debugger
        },
        format: {
          comments: false
          // 删除所有注释
        }
      },
      rollupOptions: {
        output: {
          entryFileNames: `assets/[name].[hash].js`,
          chunkFileNames: `assets/[name].[hash].js`,
          assetFileNames: `assets/[name].[hash].[ext]`,
          compact: true,
          manualChunks: {
            vue: ["vue", "vue-router", "pinia"],
            echarts: ["echarts"]
          }
        }
      }
    },
    css: { preprocessorOptions: { css: { charset: false } } },
    define: {
      __VUE_I18N_LEGACY_API__: JSON.stringify(false),
      __VUE_I18N_FULL_INSTALL__: JSON.stringify(false),
      __INTLIFY_PROD_DEVTOOLS__: JSON.stringify(false),
      __VERSION__: JSON.stringify(process.env.npm_package_version),
      __NEXT_NAME__: JSON.stringify(process.env.npm_package_name)
    }
  };
});
var vite_config_default = viteConfig;
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ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